home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_309 / sksh / .skshinit < prev    next >
Text File  |  1992-05-06  |  3KB  |  120 lines

  1. #*************************************************************************
  2. #
  3. #  Set up variables and flags
  4. #
  5. #*************************************************************************
  6.  
  7. options  +lEeFsc
  8.  
  9. PS1         = '$_ANSI_P3[$PWD]: $_ANSI_P1'
  10. PS2         = '$_ANSI_P3> $_ANSI_P1'
  11. PNPC        = 21
  12. LOGOUT      = 'echo "\nBye!\n"'
  13.  
  14. _ANSI_BS    = "^[[1m"
  15. _ANSI_BE    = "^[[m"
  16. _ANSI_IS    = "^[[3m"
  17. _ANSI_IE    = "^[[m"
  18. _ANSI_US    = "^[[4m"
  19. _ANSI_UE    = "^[[m"
  20. _ANSI_P1    = "^[[0;31;40m"
  21. _ANSI_P2    = "^[[0;32;40m"
  22. _ANSI_P3    = "^[[0;33;40m"
  23. _ANSI_CLEAR = "^[[H^[[2J"
  24.  
  25. _DIR_S      = "$_ANSI_P3"
  26. _DIR_E      = "$_ANSI_P1"
  27.  
  28. #*************************************************************************
  29. #
  30. #  Set up sksh aliases
  31. #
  32. #*************************************************************************
  33.  
  34. alias    unalias   = 'unset -a'
  35. alias    unfunc    = 'unset -f'
  36. alias    aliases   = 'set -a'
  37. alias    functions = 'set -f'
  38. alias    variables = 'set -v'
  39. alias    builtins  = 'set -b'
  40. alias    help      = 'set -bfa'
  41. alias    logout    = 'exit 0'
  42. alias    makedir   = 'mkdir'
  43. alias    delete    = 'rm'
  44. alias    remove    = 'rm'
  45. alias    pwd       = 'echo "$PWD"'
  46. alias    clear     = 'echo -n $_ANSI_CLEAR'
  47. alias    cls       = 'echo -n $_ANSI_CLEAR'
  48. alias    '!'       = 'history -e'
  49. alias    '!!'      = 'history -e -1'
  50. alias    ll        = 'ls -lbF'
  51. alias    dir       = 'ls -bF'
  52. alias    ctpri     = 'ChangeTaskPri'
  53. alias    '.'       = 'source'
  54. alias    quit      = 'LOGOUT=""; exit'
  55.  
  56.  
  57. #*************************************************************************
  58. #
  59. #  Set up sksh functions
  60. #
  61. #*************************************************************************
  62.  
  63. function path {   # set or examine path
  64.  
  65.     local component;
  66.  
  67.     if [ $# -eq 0 ]
  68.     then
  69.         echo "$PATH";
  70.     elif [ "$1" = "-add" -o "$1" = "add" ]
  71.     then
  72.         shift
  73.         for component in $* do
  74.  
  75.             if [ $( expr index "$PATH," "$component," ) -eq 0 ]
  76.             then
  77.                 PATH = "$PATH,$component"
  78.             fi
  79.  
  80.         done
  81.     else
  82.         PATH = "$1"
  83.     fi
  84.  
  85.     export PATH
  86. }
  87.  
  88. function run {  # run a program, searching the SKsh $PATH
  89.     local prog loc
  90.  
  91.     prog = $1
  92.     shift
  93.  
  94.     loc = $(which -s $prog)
  95.  
  96.     if [ -z "$loc" ]
  97.     then
  98.        echo "$prog not found."
  99.     else 
  100.        c:run $loc $*
  101.     fi
  102. }
  103.  
  104. function stack {  # set or change stack size
  105.  
  106.     if [ $# -eq 0 ]
  107.     then
  108.        c:stack
  109.        return
  110.     fi
  111.  
  112.     if [ $1 -lt 4000 -o $1 -gt 128000 ]
  113.     then
  114.        echo "Invalid stack size.  Use 4000 to 128000"
  115.        return
  116.     fi
  117.  
  118.     c:stack $(expr $1 + 12000)
  119. }
  120.